package com.iflytek.uc.service;

import java.util.List;
import java.util.Map;

import com.iflytek.uc.domain.Account;
import com.iflytek.uc.domain.Entity;
import com.iflytek.uc.exceptions.AccoutDisabledException;
import com.iflytek.uc.exceptions.DuplicateKeyException;
import com.iflytek.uc.exceptions.NoSuchAccountException;
import com.iflytek.uc.exceptions.PasswordErrorException;

public interface AccountService {

	Account doLogin(String name, String password) 
			throws NoSuchAccountException, AccoutDisabledException, PasswordErrorException;
	
	boolean doAuthenticate(String name, String password);
	
	void updatePassword(String name, String password);
	
	Account createAccount(String name, 
			String displayName, 
			int displayOrder, 
			String password,
			Map<String, Object> properties, 
			List<Entity> parents, 
			List<Entity> children) throws DuplicateKeyException;
	
	void updateAccount(String name, 
			String displayName, 
			int displayOrder,
			String password,
			boolean disabled,
			Map<String, Object> properties, 
			List<Entity> parents, 
			List<Entity> children) throws DuplicateKeyException;
	
	void deleteAccount(String name);

}
